<template>
  <div class="app-container">
    <!-- 搜索区域 -->
    <el-card class="search-card" shadow="hover" v-show="showSearch">
      <div slot="header" class="search-header">
        <i class="el-icon-search"></i>
        <span>搜索条件</span>
      </div>
      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="80px" class="search-form">
        <el-form-item label="订单编号" prop="id">
          <el-input
            v-model="queryParams.id"
            placeholder="请输入订单编号"
            clearable
            prefix-icon="el-icon-document"
            @keyup.enter.native="handleQuery"
            class="search-input"
          />
        </el-form-item>
        <el-form-item label="商品名称" prop="name">
          <el-input
            v-model="queryParams.name"
            placeholder="请输入商品名称"
            clearable
            prefix-icon="el-icon-goods"
            @keyup.enter.native="handleQuery"
            class="search-input"
          />
        </el-form-item>
        <el-form-item label="商品表ID" prop="goodId">
          <el-input
            v-model="queryParams.goodId"
            placeholder="请输入商品表ID"
            clearable
            prefix-icon="el-icon-collection-tag"
            @keyup.enter.native="handleQuery"
            class="search-input"
          />
        </el-form-item>
        <el-form-item label="规格" prop="guigeId">
          <el-select v-model="queryParams.guigeId" placeholder="请选择规格" clearable class="search-select">
            <el-option label="规格一" :value="1" />
            <el-option label="规格二" :value="2" />
            <el-option label="规格三" :value="3" />
            <el-option label="规格四" :value="4" />
          </el-select>
        </el-form-item>
        <el-form-item label="数量区间">
          <div class="quantity-range">
            <el-input
              v-model.trim="queryParams.quantityMin"
              type="number"
              placeholder="最小数量"
              class="quantity-input"
              clearable
            />
            <span class="range-separator">-</span>
            <el-input
              v-model.trim="queryParams.quantityMax"
              type="number"
              placeholder="最大数量"
              class="quantity-input"
              clearable
            />
          </div>
        </el-form-item>
        <el-form-item class="search-buttons">
          <el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery" class="search-btn">搜索</el-button>
          <el-button icon="el-icon-refresh" size="small" @click="resetQuery" class="reset-btn">重置</el-button>
        </el-form-item>
      </el-form>
    </el-card>

    <!-- 操作按钮区域 -->
    <el-card class="action-card" shadow="hover">
      <div class="action-buttons">

        <el-button
          type="success"
          icon="el-icon-edit"
          size="small"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['detail:detail:edit']"
          class="action-btn edit-btn"
        >
          <i class="el-icon-edit"></i>
          修改
        </el-button>
        <el-button
          type="danger"
          icon="el-icon-delete"
          size="small"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['detail:detail:remove']"
          class="action-btn delete-btn"
        >
          <i class="el-icon-delete"></i>
          删除
        </el-button>
        <el-button
          type="warning"
          icon="el-icon-download"
          size="small"
          @click="handleExport"
          v-hasPermi="['detail:detail:export']"
          class="action-btn export-btn"
        >
          <i class="el-icon-download"></i>
          导出
        </el-button>
        <div class="toolbar-wrapper">
          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
        </div>
      </div>
    </el-card>

    <!-- 数据表格区域 -->
    <el-card class="table-card" shadow="hover">
      <div slot="header" class="table-header">
        <i class="el-icon-s-order"></i>
        <span>订单详情列表</span>
        <span class="table-count">共 {{ total }} 条记录</span>
      </div>
      <el-table
        v-loading="loading"
        :data="detailList"
        @selection-change="handleSelectionChange"
        stripe
        highlight-current-row
        class="data-table"
        :header-cell-style="{ background: '#f5f7fa', color: '#606266' }"
      >
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column label="订单编号" align="center" prop="id" min-width="100">
          <template slot-scope="scope">
            <el-tag type="primary" size="small">{{ scope.row.id }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column label="商品名称" align="center" prop="name" min-width="150">
          <template slot-scope="scope">
            <div class="product-name">
              <i class="el-icon-goods"></i>
              <span>{{ scope.row.name }}</span>
            </div>
          </template>
        </el-table-column>
        <el-table-column label="商品图片" align="center" prop="image" width="120">
          <template slot-scope="scope">
            <div class="product-image">
              <image-preview v-if="scope.row.image" :src="scope.row.image" :width="60" :height="60"/>
              <div v-else class="no-image">
                <i class="el-icon-picture-outline"></i>
                <span>无图片</span>
              </div>
            </div>
          </template>
        </el-table-column>
        <el-table-column label="详情表ID" align="center" prop="orderId" min-width="100">
          <template slot-scope="scope">
            <el-tag type="info" size="small">{{ scope.row.orderId }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column label="商品表ID" align="center" prop="goodId" min-width="100">
          <template slot-scope="scope">
            <el-tag type="warning" size="small">{{ scope.row.goodId }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column label="规格" align="center" prop="guigeId" min-width="80">
          <template slot-scope="scope">
            <el-tag type="success" size="small">规格{{ scope.row.guigeId }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column label="数量" align="center" prop="quantity" min-width="80">
          <template slot-scope="scope">
            <span class="quantity-text">{{ scope.row.quantity }}</span>
          </template>
        </el-table-column>
        <el-table-column label="单价" align="center" prop="amount" min-width="100">
          <template slot-scope="scope">
            <span class="price-text">¥{{ scope.row.amount }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" width="280" class-name="operation-column">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="primary"
              icon="el-icon-view"
              @click="handleViewDetail(scope.row)"
              v-hasPermi="['detail:detail:query']"
              class="operation-btn view-btn"
            >
              查询详情
            </el-button>
            <el-button
              size="mini"
              type="success"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
              v-hasPermi="['detail:detail:edit']"
              class="operation-btn edit-btn"
            >
              修改
            </el-button>
            <el-button
              size="mini"
              type="danger"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
              v-hasPermi="['detail:detail:remove']"
              class="operation-btn delete-btn"
            >
              删除
            </el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-card>

    <!-- 分页组件 -->
    <div class="pagination-wrapper" v-show="total>0">
      <pagination
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />
    </div>

    <!-- 添加或修改订单详情对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body class="edit-dialog">
      <div class="dialog-content">
        <el-form ref="form" :model="form" :rules="rules" label-width="120px" class="form-content">
          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="订单编号" prop="id">
                <el-input v-model="form.id" placeholder="自动生成" disabled class="form-input" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="详情表ID" prop="orderId">
                <el-input-number v-model="form.orderId" :min="0" :controls="false" style="width: 100%" placeholder="请输入详情表ID" class="form-input" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="商品名称" prop="name">
                <el-input v-model="form.name" placeholder="请输入商品名称" class="form-input" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="商品表ID" prop="goodId">
                <el-input-number v-model="form.goodId" :min="0" :controls="false" style="width: 100%" placeholder="请输入商品表ID" class="form-input" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="规格" prop="guigeId">
                <el-select v-model="form.guigeId" placeholder="请选择规格" clearable style="width: 100%" class="form-select">
                  <el-option label="规格一" :value="1" />
                  <el-option label="规格二" :value="2" />
                  <el-option label="规格三" :value="3" />
                  <el-option label="规格四" :value="4" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="数量" prop="quantity">
                <el-input-number v-model="form.quantity" :min="0" :step="1" :controls="false" style="width: 100%" placeholder="请输入数量" class="form-input" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="单价" prop="amount">
                <el-input-number v-model="form.amount" :min="0" :step="0.01" :precision="2" :controls="false" style="width: 100%" placeholder="请输入单价" class="form-input" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="商品图片" prop="image" class="image-item">
                <image-upload v-model="form.image" />
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" icon="el-icon-check" @click="submitForm" class="submit-btn">确 定</el-button>
        <el-button icon="el-icon-close" @click="cancel" class="cancel-btn">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 订单详情信息弹出框 -->
    <el-dialog title="订单详情信息" :visible.sync="detailOpen" width="1000px" append-to-body class="detail-dialog">
      <div v-if="detailInfo" class="detail-content">
        <div class="detail-section">
          <div class="section-header">
            <i class="el-icon-s-order"></i>
            <span>订单商品信息</span>
          </div>
          <el-descriptions :column="2" border class="detail-descriptions">
            <el-descriptions-item label="订单编号">
              <el-tag type="primary" size="small">{{ detailInfo.number }}</el-tag>
            </el-descriptions-item>
            <el-descriptions-item label="用户ID">
              <el-tag type="info" size="small">{{ detailInfo.userId }}</el-tag>
            </el-descriptions-item>
            <el-descriptions-item label="收货人">
              <span class="detail-value">{{ detailInfo.consignee }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="手机号">
              <span class="detail-value">{{ detailInfo.phone }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="收货地址">
              <span class="detail-value address-text">{{ detailInfo.address }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="订单状态">
              <el-tag :type="detailInfo.orderStatus === '1' ? 'success' : 'warning'" size="small">
                {{ detailInfo.orderStatus === '1' ? '已完成' : '进行中' }}
              </el-tag>
            </el-descriptions-item>
            <el-descriptions-item label="支付状态">
              <el-tag :type="detailInfo.payStatus === 0 ? 'danger' : 'success'" size="small">
                {{ detailInfo.payStatus === 0 ? '未支付' : '已支付' }}
              </el-tag>
            </el-descriptions-item>
            <el-descriptions-item label="支付方式">
              <span class="detail-value">{{ detailInfo.payMethod }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="商品单价">
              <span class="price-value">¥{{ detailInfo.goodsPrice }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="小计金额">
              <span class="total-value">¥{{ detailInfo.subtotal }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="创建时间">
              <span class="detail-value">{{ detailInfo.createTime }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="支付时间">
              <span class="detail-value">{{ detailInfo.payTime || '未支付' }}</span>
            </el-descriptions-item>
          </el-descriptions>
        </div>

        <el-divider content-position="left" class="section-divider">
          <i class="el-icon-goods"></i>
          <span>商品详情信息</span>
        </el-divider>

        <div class="detail-section">
          <el-descriptions :column="2" border class="detail-descriptions">
            <el-descriptions-item label="商品名称">
              <span class="detail-value product-name">{{ detailInfo.name }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="商品图片">
              <div class="product-image-container">
                <image-preview v-if="detailInfo.image" :src="detailInfo.image" :width="80" :height="80"/>
                <div v-else class="no-image-placeholder">
                  <i class="el-icon-picture-outline"></i>
                  <span>无图片</span>
                </div>
              </div>
            </el-descriptions-item>
            <el-descriptions-item label="规格">
              <el-tag type="success" size="small">规格{{ detailInfo.guigeId }}</el-tag>
            </el-descriptions-item>
            <el-descriptions-item label="数量">
              <span class="detail-value">{{ detailInfo.quantity }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="单价">
              <span class="price-value">¥{{ detailInfo.amount }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="详情表ID">
              <el-tag type="warning" size="small">{{ detailInfo.orderId }}</el-tag>
            </el-descriptions-item>
          </el-descriptions>
        </div>

        <div v-if="detailInfo.cancelReson" class="alert-section">
          <el-alert
            title="取消原因"
            :description="detailInfo.cancelReson"
            type="warning"
            show-icon
            class="detail-alert">
          </el-alert>
        </div>

        <div v-if="detailInfo.rejectionReson" class="alert-section">
          <el-alert
            title="拒收原因"
            :description="detailInfo.rejectionReson"
            type="error"
            show-icon
            class="detail-alert">
          </el-alert>
        </div>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" icon="el-icon-close" @click="detailOpen = false" class="close-btn">关 闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listDetail, getDetail, delDetail, addDetail, updateDetail, getOrderDetailWithGoods } from "@/api/detail/detail"

export default {
  name: "Detail",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 订单详情表格数据
      detailList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 是否显示详情弹出层
      detailOpen: false,
      // 详情信息
      detailInfo: null,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        id: null,
        name: null,
        goodId: null,
        guigeId: null,
        quantity: null,
        quantityMin: null,
        quantityMax: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        name: [{ required: true, message: '请输入商品名称', trigger: 'blur' }],
        goodId: [{ type: 'number', message: '商品表id必须为数字', trigger: 'change' }],
        guigeId: [{ required: true, message: '请选择规格', trigger: 'change' }],
        quantity: [{ type: 'number', required: true, message: '请输入数量', trigger: 'change' }],
        amount: [{ type: 'number', required: true, message: '请输入单价', trigger: 'change' }]
      }
    }
  },
  created() {
    this.getList()
  },
  methods: {
    // 重置查询：清空表单并清除区间参数
    resetQuery() {
      this.queryParams = {
        pageNum: 1,
        pageSize: 10,
        id: null,
        name: null,
        goodId: null,
        guigeId: null,
        quantity: null,
        quantityMin: null,
        quantityMax: null,
      }
      this.$nextTick(() => this.getList())
    },
    /** 查询订单详情列表 */
    getList() {
      this.loading = true
      listDetail(this.queryParams).then(response => {
        this.detailList = response.rows
        this.total = response.total
        this.loading = false
      })
    },
    // 取消按钮
    cancel() {
      this.open = false
      this.reset()
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        name: null,
        image: null,
        orderId: null,
        goodId: null,
        guigeId: null,
        quantity: null,
        amount: null
      }
      this.resetForm("form")
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1
      this.getList()
    },
    /** 重置按钮操作 */

    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset()
      this.open = true
      this.title = "添加订单详情"
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset()
      const id = row.id || this.ids
      getDetail(id).then(response => {
        this.form = response.data
        this.open = true
        this.title = "修改订单详情"
      })
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateDetail(this.form).then(response => {
              this.$modal.msgSuccess("修改成功")
              this.open = false
              this.getList()
            })
          } else {
            addDetail(this.form).then(response => {
              this.$modal.msgSuccess("新增成功")
              this.open = false
              this.getList()
            })
          }
        }
      })
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids
      this.$modal.confirm('是否确认删除订单详情编号为"' + ids + '"的数据项？').then(function() {
        return delDetail(ids)
      }).then(() => {
        this.getList()
        this.$modal.msgSuccess("删除成功")
      }).catch(() => {})
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('detail/detail/export', {
        ...this.queryParams
      }, `detail_${new Date().getTime()}.xlsx`)
    },

    /** 查询详情信息按钮操作 */
    handleViewDetail(row) {
      this.detailInfo = null
      this.detailOpen = true
      getOrderDetailWithGoods(row.orderId).then(response => {
        this.detailInfo = response.data
      }).catch(() => {
        this.$modal.msgError("查询失败")
        this.detailOpen = false
      })
    }
  }
}
</script>

<style scoped>
/* 整体容器样式 */
.app-container {
  padding: 20px;
  background: #f5f7fa;
  min-height: calc(100vh - 84px);
}

/* 搜索卡片样式 */
.search-card {
  margin-bottom: 20px;
  border-radius: 8px;
  border: none;
}

.search-card ::v-deep(.el-card__header) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px 8px 0 0;
  padding: 15px 20px;
}

.search-header {
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
}

.search-header i {
  margin-right: 8px;
  font-size: 18px;
}

.search-form {
  padding: 20px 0;
}

.search-input {
  width: 200px;
}

.search-select {
  width: 200px;
}

.quantity-range {
  display: flex;
  align-items: center;
}

.quantity-input {
  width: 120px;
}

.range-separator {
  margin: 0 10px;
  color: #909399;
  font-weight: bold;
}

.search-buttons {
  margin-left: 20px;
}

.search-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
}

.reset-btn {
  background: #f5f7fa;
  border: 1px solid #dcdfe6;
  color: #606266;
  padding: 10px 20px;
  border-radius: 6px;
}

/* 操作按钮卡片样式 */
.action-card {
  margin-bottom: 20px;
  border-radius: 8px;
  border: none;
}

.action-card ::v-deep(.el-card__body) {
  padding: 15px 20px;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.add-btn {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.edit-btn {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.delete-btn {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.export-btn {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  color: #606266;
}

.toolbar-wrapper {
  margin-left: auto;
}

/* 表格卡片样式 */
.table-card {
  margin-bottom: 20px;
  border-radius: 8px;
  border: none;
}

.table-card ::v-deep(.el-card__header) {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  border-radius: 8px 8px 0 0;
  padding: 15px 20px;
}

.table-header {
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
}

.table-header i {
  margin-right: 8px;
  font-size: 18px;
}

.table-count {
  margin-left: auto;
  font-size: 14px;
  opacity: 0.9;
}

.data-table {
  border-radius: 6px;
  overflow: hidden;
}

.data-table ::v-deep(.el-table__header) {
  background: #f5f7fa;
}

.data-table ::v-deep(.el-table__row:hover) {
  background: #f0f9ff !important;
}

/* 表格列样式 */
.product-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.product-name i {
  color: #409eff;
}

.product-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.no-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #c0c4cc;
  font-size: 12px;
}

.no-image i {
  font-size: 24px;
  margin-bottom: 4px;
}

.quantity-text {
  font-weight: 600;
  color: #409eff;
}

.price-text {
  font-weight: 600;
  color: #f56c6c;
}

.operation-column {
  padding: 8px 0;
}

.operation-btn {
  margin: 2px;
  border-radius: 4px;
  font-size: 12px;
  padding: 6px 12px;
}

.view-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
}

.edit-btn {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  border: none;
}

.delete-btn {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  border: none;
}

/* 分页样式 */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* 对话框样式 */
.edit-dialog ::v-deep(.el-dialog__header) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px 8px 0 0;
  padding: 20px;
}

.edit-dialog ::v-deep(.el-dialog__footer) {
  border-top: 1px solid #ebeef5;
  padding: 20px;
  background: #f5f7fa;
}

.detail-dialog ::v-deep(.el-dialog__header) {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  border-radius: 8px 8px 0 0;
  padding: 20px;
}

.detail-dialog ::v-deep(.el-dialog__footer) {
  border-top: 1px solid #ebeef5;
  padding: 20px;
  background: #f5f7fa;
}

.dialog-content {
  padding: 20px 0;
}

.form-content {
  padding: 0 20px;
}

.form-input, .form-select {
  border-radius: 6px;
}

.submit-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
}

.cancel-btn {
  background: #f5f7fa;
  border: 1px solid #dcdfe6;
  color: #606266;
  padding: 12px 24px;
  border-radius: 6px;
}

/* 详情弹出框样式 */
.detail-content {
  padding: 0 20px;
}

.detail-section {
  margin-bottom: 30px;
}

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: 600;
  color: #303133;
}

.section-header i {
  margin-right: 8px;
  color: #409eff;
}

.detail-descriptions {
  border-radius: 6px;
  overflow: hidden;
}

.detail-value {
  font-weight: 500;
  color: #303133;
}

.address-text {
  max-width: 200px;
  word-break: break-all;
}

.price-value {
  font-weight: 600;
  color: #f56c6c;
}

.total-value {
  font-weight: 600;
  color: #67c23a;
  font-size: 16px;
}

.product-name {
  font-weight: 600;
  color: #409eff;
}

.product-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.no-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #c0c4cc;
  font-size: 12px;
}

.no-image-placeholder i {
  font-size: 32px;
  margin-bottom: 8px;
}

.section-divider {
  margin: 30px 0;
  color: #409eff;
  font-weight: 600;
}

.section-divider i {
  margin-right: 8px;
}

.alert-section {
  margin-top: 20px;
}

.detail-alert {
  border-radius: 6px;
}

.close-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
}

.image-item {
  display: flex;
  align-items: center;
}

.el-form-item {
  margin-bottom: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .app-container {
    padding: 10px;
  }

  .search-input, .search-select {
    width: 100%;
  }

  .action-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-wrapper {
    margin-left: 0;
    margin-top: 10px;
  }
}
</style>
